package cn.lls.service.impl;

import cn.lls.entity.company.AnnouncementEntity;
import cn.lls.dao.AnnouncementDao;
import cn.lls.req.emp.ConditionSearchAnnoReq;
import cn.lls.service.IAnnouncementService;
import cn.lls.vo.emp.AnnoInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 划水艺术家
 * @since 2022-11-15
 */
@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementDao, AnnouncementEntity> implements IAnnouncementService {


    @Override
    public IPage<AnnoInfo> getAnnoByConditionAndPage(ConditionSearchAnnoReq conditionSearchAnnoReq) {
        IPage page = new Page<>(conditionSearchAnnoReq.getCurrentPage(), conditionSearchAnnoReq.getPageSize());
        return this.baseMapper.getAnnoByConditionAndPage(page, conditionSearchAnnoReq);
    }

    @Override
    public AnnoInfo getAnnoById(Long id) {
        return this.baseMapper.getAnnoById(id);
    }
}
